#! /usr/bin/env python
#coding=utf-8
h, m = map(int, input().split(':'));
H = h;
while True:
    M = H / 10 + 10 * (H % 10);
    if M < 60 and (H != h or m < M):
        break;
    H = (H + 1) % 24;
print("%02d:%02d" %(H, M));
